package com.kede.app.domain;

import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @description /
* @author Pr.li
* @date 2023-05-11
**/
@Entity
@Data
@Table(name="sy_users")
public class Users implements Serializable {
    /**
    * 主键
    */
    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    private Integer id;
    /**
    * 积分数量
    */
    @ApiModelProperty(value = "积分数量")
    @Column(name = "`integral`")
    private BigDecimal integral;
    /**
    * 1会员0非会员
    */
    @ApiModelProperty(value = "1会员0非会员")
    @Column(name = "`is_vip`")
    private Integer isVip;
    /**
    * 1用户2骑手3门店4区代理5市代理
    */
    @ApiModelProperty(value = "1用户2骑手3门店4区代理5市代理")
    @Column(name = "`user_type`")
    private Integer userType;
    /**
    * 用户昵称
    */
    @ApiModelProperty(value = "用户昵称")
    @Column(name = "`users_name`")
    private String usersName;
    /**
    * 用户头像
    */
    @ApiModelProperty(value = "用户头像")
    @Column(name = "`users_image`")
    private String usersImage;
    /**
    * 用户性别
    */
    @ApiModelProperty(value = "用户性别")
    @Column(name = "`users_sex`")
    private Integer usersSex;
    /**
    * 用户电话
    */
    @ApiModelProperty(value = "用户电话")
    @Column(name = "`users_phone`",nullable = false)
    @NotBlank
    private String usersPhone;
    /**
    * 所属代理
    */
    @ApiModelProperty(value = "所属代理")
    @Column(name = "`admin_id`")
    private Integer adminId;
    /**
    *  唯一表示凭证
    */
    @ApiModelProperty(value = " 唯一表示凭证")
    @Column(name = "`open_id`")
    private String openId;
    /**
    * 用户总收入
    */
    @ApiModelProperty(value = "用户总收入")
    @Column(name = "`count_money`")
    private BigDecimal countMoney;
    /**
    * 用户已提现金额
    */
    @ApiModelProperty(value = "用户已提现金额")
    @Column(name = "`withdraw_money`")
    private BigDecimal withdrawMoney;
    /**
    * 用户当前余额
    */
    @ApiModelProperty(value = "用户当前余额")
    @Column(name = "`residue_money`")
    private BigDecimal residueMoney;
    /**
    * token
    */
    @ApiModelProperty(value = "token")
    @Column(name = "`token`")
    private String token;
    /**
    * token过期时间
    */
    @ApiModelProperty(value = "token过期时间")
    @Column(name = "`expiration_time`")
    private Integer expirationTime;
    /**
    * 更新时间
    */
    @ApiModelProperty(value = "更新时间")
    @Column(name = "`createtime`")
    private Integer createtime;
    /**
    * 用户状态:1=正常 ,2=拉黑
    */
    @ApiModelProperty(value = "用户状态:1=正常 ,2=拉黑")
    @Column(name = "`status`")
    private String status;
    /**
    * 用户密码
    */
    @ApiModelProperty(value = "用户密码")
    @Column(name = "`password`")
    private String password;
    /**
    * 出生日期
    */
    @ApiModelProperty(value = "出生日期")
    @Column(name = "`birthday`")
    private String birthday;
    /**
    * 
    */
    @ApiModelProperty(value = "sex")
    @Column(name = "`sex`")
    private Integer sex;
    /**
    * 
    */
    @ApiModelProperty(value = "openid")
    @Column(name = "`openid`",nullable = false)
    @NotBlank
    private String openid;
    /**
    * 小程序openid
    */
    @ApiModelProperty(value = "小程序openid")
    @Column(name = "`xcx_openid`")
    private String xcxOpenid;
    /**
    * app骑手端openid
    */
    @ApiModelProperty(value = "app骑手端openid")
    @Column(name = "`app_rider_openid`")
    private String appRiderOpenid;
    /**
    * 
    */
    @ApiModelProperty(value = "xcxRiderOpenid")
    @Column(name = "`xcx_rider_openid`")
    private String xcxRiderOpenid;
    /**
    * 门店端小程序openid
    */
    @ApiModelProperty(value = "门店端小程序openid")
    @Column(name = "`xcx_store_openid`")
    private String xcxStoreOpenid;
    /**
    * 小程序区代理
    */
    @ApiModelProperty(value = "小程序区代理")
    @Column(name = "`xcx_qu_openid`")
    private String xcxQuOpenid;
    /**
    * 小程序市代理openid
    */
    @ApiModelProperty(value = "小程序市代理openid")
    @Column(name = "`xcx_shi_openid`")
    private String xcxShiOpenid;
    /**
    * 
    */
    @ApiModelProperty(value = "thumb")
    @Column(name = "`thumb`")
    private String thumb;
    /**
    * 是否是新用户
    */
    @ApiModelProperty(value = "是否是新用户")
    @Column(name = "`is_new`")
    private Integer isNew;
    /**
    * 
    */
    @ApiModelProperty(value = "lastid")
    @Column(name = "`lastid`")
    private Integer lastid;
    /**
    * 余额
    */
    @ApiModelProperty(value = "余额")
    @Column(name = "`user_money`")
    private BigDecimal userMoney;
    /**
    * 
    */
    @ApiModelProperty(value = "wxQrcode")
    @Column(name = "`wx_qrcode`")
    private String wxQrcode;
    /**
    * 
    */
    @ApiModelProperty(value = "wxName")
    @Column(name = "`wx_name`")
    private String wxName;
    /**
    * 
    */
    @ApiModelProperty(value = "alipayQrcode")
    @Column(name = "`alipay_qrcode`")
    private String alipayQrcode;
    /**
    * 
    */
    @ApiModelProperty(value = "alipayName")
    @Column(name = "`alipay_name`")
    private String alipayName;
    /**
    * 本月已兑换数量
    */
    @ApiModelProperty(value = "本月已兑换数量")
    @Column(name = "`yet_num`")
    private Integer yetNum;
    /**
    * 会员到期时间
    */
    @ApiModelProperty(value = "会员到期时间")
    @Column(name = "`expire_time`")
    private Integer expireTime;
    /**
    * 支付密码
    */
    @ApiModelProperty(value = "支付密码")
    @Column(name = "`pay_pwd`")
    private String payPwd;
    /**
    * 省市区
    */
    @ApiModelProperty(value = "省市区")
    @Column(name = "`address`")
    private String address;
    /**
    * 详细地址
    */
    @ApiModelProperty(value = "详细地址")
    @Column(name = "`address_detail`")
    private String addressDetail;

    public void copy(Users source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
